//-----------------------------------------------------------------------
// <copyright file="IHandler.cs" company="iron9light">
//      Copyright (c) iron9light. All rights reserved.
// </copyright>
// <author>iron9light</author>
//-----------------------------------------------------------------------

namespace EventBroker
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// The interface of a subcription handler.
    /// </summary>
    public interface IHandler
    {
        /// <summary>
        /// Gets or sets the subscription handler.
        /// </summary>
        /// <value>The subscription handler.</value>
        Delegate SubscriptionHandler { get; set; }

        /// <summary>
        /// Executes the subscription.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <param name="exceptions">The exceptions that occured during the execution. For implementors: Add exception here, Handle must not throw exceptions.</param>
        void Handle(object sender, EventArgs e, ICollection<Exception> exceptions);
    }
}